<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/commons/inc.jsp" %>

<h3 id="navTitleId">血糖指标</h3>

<body id="body">

<%@include file="/commons/showmessage.jsp" %>

<form name="SearchForm" id="SearchForm" method="post" action="${contextPath}/lab/lab.action?method=searchLabSugar">
	<s:hidden name="patientid" id="patientid"></s:hidden>
	<table>
		<tr>
			<td class="tdLabel"><label class="label">葡萄糖 检查时间:</label></td>
			 <td class="tdLabel">
				<select name="testtime" id="testtime" onchange="changeSel()">
					<option value="0" <s:if test="testtime == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="testtime == 1">selected</s:if>>早餐前（空腹）</option>
					<option value="2" <s:if test="testtime == 2">selected</s:if>>午餐前</option>
					<option value="3" <s:if test="testtime == 3">selected</s:if>>晚餐前</option>
					<option value="4" <s:if test="testtime == 4">selected</s:if>>早餐后2h</option>
					<option value="5" <s:if test="testtime == 5">selected</s:if>>午餐后2h</option>
					<option value="6" <s:if test="testtime == 6">selected</s:if>>晚餐后2h</option>
					<option value="7" <s:if test="testtime == 7">selected</s:if>>10pm</option>
					<option value="8" <s:if test="testtime == 8">selected</s:if>>12pm</option>
					<option value="9" <s:if test="testtime == 9">selected</s:if>>3am</option>
					<option value="10" <s:if test="testtime == 10">selected</s:if>>随机</option>
				</select></td>
			<td class="tdLabel"><label class="label">检查方式:</label></td>	
			<td class="tdLabel"><select name="testmethod" id="testmethod" onchange="changeSel()">
					<option value="0" <s:if test="testmethod == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="testmethod == 1">selected</s:if>>毛细血管血糖(CBG)</option>
					<option value="2" <s:if test="testmethod == 2">selected</s:if>>静脉血清血糖(VSG)</option>
				</select></td>	
	 	</tr>
	 </table>
</form>

<form name="labsugarform" id="labsugarform" method="post" action="${contextPath}/lab/lab.action?method=saveEditLabSugar">
	<s:hidden name="labsugar.sugarid" id="labsugar.sugarid"></s:hidden>
	<s:hidden name="labsugar.patientid" id="labsugar.patientid"></s:hidden>
	<s:hidden name="patientid" id="patientid"></s:hidden>
	<s:hidden name="testtime" id="testtime"></s:hidden>
	<s:hidden name="testmethod" id="testmethod"></s:hidden>
	<table border="0" cellspacing="1" cellpadding="0" class="formTable" width="100%" >
	<tbody> 
		<tr>
			<td align="left" class="form-td"><label class="label">血糖值:</label></td>
			<td align="left" class="form-td" colspan="3"><input type="text" name="labsugar.sugar" id="labsugar.sugar" size="5" value="${labsugar.sugar}"/>mmol/L</td>
		</tr>
		<tr>
			<td align="left" class="form-td"><label class="label">糖化血红蛋白:</label></td>
			<td align="left" class="form-td"><input type="text" name="labsugar.xuehong" id="labsugar.xuehong" size="5" value="${labsugar.xuehong}"/>%</td>
			<td align="left" class="form-td"><label class="label">糖化血清蛋白:</label></td>
			<td align="left" class="form-td"><input type="text" name="labsugar.xueqing" id="labsugar.xueqing" size="5" value="${labsugar.xueqing}"/>mmol/L</td>
		</tr>
		<tr>	
			<td align="left" class="form-td"><label class="label">血酮体:</label></td>
			<td align="left" class="form-td"><input type="text" name="labsugar.tongti" id="labsugar.tongti" size="5" value="${labsugar.tongti}"/>mg/L</td>
			<td align="left" class="form-td"><label class="label">乳酸:</label></td>
			<td align="left" class="form-td"><input type="text" name="labsugar.rusuan" id="labsugar.rusuan" size="5" value="${labsugar.rusuan}"/>mmol/L</td>
		</tr>
		</tbody>
		</table>
		<table>
		<tr>
			<td align="center" colspan="4">
			<input type="reset" value="重置"> 
		    <input type="button" onclick="saveEdit('save');" value="保存"></td>
		</tr>
	</table>
</form>
<%@include file="/commons/tableSel.jsp" %>

</body>

<style type="text/css">
body {
	height: 100%;
	width: 100%;
}
</style>

<script>
function saveEdit(type){
	if(type=='refresh'){
		location.reload();
	}else if(type=='save'){
		if(!Validator.Validate($('labsugarform'),3)){
			return;
		}	
		$('labsugarform').submit();
	}
}
function changeSel(){
	var obj = $('testmethod');
	if(obj.options[obj.selectedIndex].value>0){
		document.SearchForm.submit();
	}
}
</script>